﻿@model PhotoGallery.Models.PhotoInfo
@using PhotoGallery.Views
@{
    ViewBag.Title = "Edit";
}
@section javascript{
    <script src="@Url.Content("~/Scripts/InputTypeFile.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/InputTypeFile.css")" rel="stylesheet" />
}
<h2>@Labels.edit</h2>

@using (Html.BeginForm(Html.BeginForm("Edit", "Photo", FormMethod.Post, new { enctype = "multipart/form-data" })))
{

    <fieldset>
        <legend>@Labels.photo</legend>
        @Html.ValidationSummary(true)

        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.FileName)
        @Html.HiddenFor(model => model.Url)

        @*<img alt="@Model.Description" src="@Url.Action("Thumbnail", new { file = Model.FullFileName })" />*@
        <img alt="@Model.Title"  src="@Url.Content(Model.UrlThumbnail)" />
        <div class="editor-label">
            @Labels.uploadFile
        </div>
        <div class="editor-field">
            <div class="styleFileInput">        
              <input type="text" id="browseText" class="browseText" /> 
              <input type="button" value="Browse" class="browseButton" /> 
              <input type="file" name="file" accept="image/*"  class="theFileInput" >
            </div>
    
        </div>
       <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <p>
            <input type="submit" value="@Labels.save" />
            <a href="@Html.Encode(ViewBag.backUrl)" class="button-link-100" >@Labels.cancel </a>
        </p>
    </fieldset>
}


